# Maintainer: David Runge <dave@sleepmap.de>
pkgname=zita-at1
pkgver=0.6.2
pkgrel=3
pkgdesc="An 'autotuner' Jack application."
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/zita-at1-doc/quickguide.html"
license=('GPL2')
groups=('pro-audio')
depends=('cairo' 'clxclient' 'clthreads' 'fftw' 'jack' 'zita-resampler')
makedepends=('gendesk')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pkgname}-${pkgver}.tar.bz2")
sha512sums=('51845c9e04c456840408731b9d9144583ba1d70f52028432c2e240c261b4d1460330a96b5622d6ee33276f037a947c32fdb0bc70cb73c06d3621e406bee2e0f8')

prepare() {
  cd "${pkgname}-${pkgver}"
  # strip march=native
  sed -e '/native/d' \
      -i source/Makefile
  # XDG desktop file
  gendesk -n \
          --pkgname ${pkgname} \
          --pkgdesc "${pkgdesc}" \
          --name zita-at1 \
          --categories "AudioVideo;Audio"
}

build() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr
}

package() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr DESTDIR="$pkgdir/" install
  # XDG desktop integration
  install -vDm 644 "../${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  install -t "${pkgdir}/usr/share/doc/${pkgname}" \
    -vDm 644 ../AUTHORS \
    -vDm 644 ../doc/*
}
# vim:set ts=2 sw=2 et:
